package Sudoku;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Unit {
	private int row = 0;
	private int line = 0;
//	private int block = 0;
//	private int numb = 0;
	private boolean fixed = false;
	 int[] list ={1,2,3,4,5,6,7,8,9};
	private int A = 0;
	private int temp0 = 0;

	public boolean isSingle() {
		boolean flag = false;
		int temp = 0;
		for(int i = 0; i < 9; i++) {
			if (list[i] != 0) {
				temp++;
				temp0 = list[i];
			}
		}
		if(temp == 1)	{
			flag = true; 
		}else {
			temp0 = 0;
		}
		return flag;
	}
	
	public void remove(int a) {
		for(int i = 0; i < 9; i++) {
			if (list[i] == a) {
				list[i] = 0;
			}
		}
	}
	
	public void change() {
			A = temp0;
	}
	
	public int output() {
		return A;
	}
	
	public String getList() {
		String temp = null;
		for(int i = 0; i < 9; i++) {
			if(list[i] != 0) {
				temp += list[i];
				temp += " ";
			}
		}
		return temp;
	}
}
